<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<title></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="stylesheet" type="text/css" href="../../css/cloud-admin.css">
	<link rel="stylesheet" type="text/css" href="../../css/themes/default.css" id="skin-switcher">
	<link rel="stylesheet" type="text/css" href="../../css/responsive.css">
	<link href="../../font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<!-- SELECT2 -->
	<link rel="stylesheet" type="text/css" href="../../js/select2/select2.min.css" />
	<!-- UNIFORM -->
	<link rel="stylesheet" type="text/css" href="../../js/uniform/css/uniform.default.min.css" />
	<!-- datatable -->
	<link rel="stylesheet" href="../../js/datatables/datatable.css">
	<link rel="stylesheet" href="../../js/datepicker/datepicker.css">
	<style>
		label {
			margin-bottom: 0;
		}
		.dataTables_scrollHeadInner {
			width: auto !important;
		}

		.dataTables_scrollHeadInner table {
			width: 100% !important;
		}
		.box-body {
			overflow: hidden;
		}
	</style>
</head>

<body>
	<header class="navbar clearfix" id="header">
	</header>

	<!-- PAGE -->
	<section id="page">
		<!-- SIDEBAR -->
		<div id="sidebar" class="sidebar">
			<div class="sidebar-menu nav-collapse">

				<!-- SIDEBAR MENU -->
				<ul>
				</ul>
			</div>


		</div>
		<!-- /SIDEBAR -->
		<div id="main-content">





			<div class="container">
				<div class="row">
					<div id="content" class="col-lg-12">
						<!-- PAGE HEADER-->
						<div class="row">
							<div class="col-sm-12">
								<div class="page-header">
									<!-- STYLER -->

									<!-- /STYLER -->
									<!-- BREADCRUMBS -->
									<ul class="breadcrumb">
										<li>
											<i class="fa fa-home"></i>
											<a href="index.html">首页</a>
										</li>
										<li>
											<a href="#">营销管理</a>
										</li>
										<li>优惠劵</li>
									</ul>
									<!-- /BREADCRUMBS -->

								</div>
							</div>
						</div>
						<!-- /PAGE HEADER -->
						<!-- FORMS QUERY-->
						<div class="row">
							<div class="col-md-12">
								<div class="row">
									<div class="col-md-12">
										<div class="box border primary">
											<div class="box-title">
												<h4><i class="fa fa-bars"></i>查询条件</h4>
											</div>
											<div class="box-body big" style="padding:10px;">
												<form id="form">
													<div class="form-group mrg-bt10">
														<label class="col-sm-1 control-label"
															style="width: auto">用户账号：</label>
														<div class="col-sm-1">
															<input type="text" class="form-control" name="userName"
																placeholder="输入关键字">
														</div>
														<label class="col-sm-1 control-label"
															style="width: auto">昵称：</label>
														<div class="col-sm-1">
															<input type="text" class="form-control" name="nickName"
																placeholder="输入关键字">
														</div>
														<label class="col-sm-1 control-label"
															style="width: auto">会员等级：</label>
														<div class="col-sm-2" style="margin-left: 12px">
															<select id="searchLevel" name="searchLevel"
																class="col-md-12 select2-offscreen" tabindex="-1">
																<option value="">全部</option>
															</select>
														</div>
														<label class="col-sm-1 control-label"
															style="width: auto">加入日期：</label>
														<div style="display:inline-flex;float: left;">
															<div style="width:130px">
																<input type="text" name="startDate" id="startDate"
																	class="form-control bootstrap-datepicker">
															</div>
															<div style="width: 20px;text-align: center;">至</div>
															<div class="float-left" style="width:130px">
																<input type="text" name="endDate" id="endDate"
																	class="form-control bootstrap-datepicker">
															</div>
														</div>
														
													</div>
													<div class="form-group mrg-bt10">
															<label class="col-sm-1 control-label"
															style="width: auto">耕耘日期：</label>
														<div style="display:inline-flex;float: left;">
															<div style="width:130px">
																<input type="text" name="startDate" id="orderStartDate"
																	class="form-control bootstrap-datepicker">
															</div>
															<div style="width: 20px;text-align: center;">至</div>
															<div class="float-left" style="width:130px">
																<input type="text" name="endDate" id="orderEndDate"
																	class="form-control bootstrap-datepicker">
															</div>
														</div>
														<div class="col-sm-1" style="display:inline-flex;width: auto;">
															<a class="btn btn-primary search">查询</a>
														</div>
													</div>
												</form>
											</div>
										</div>
									</div>
								</div>


							</div>
						</div>
						<!-- /FORMS QUERY -->

						<div class="row">
							<!-- TABLES -->
							<div class="col-md-12">
								<!-- BOX -->
								<div class="box border primary">
									<div class="box-title">
										<h4><i class="fa fa-table"></i>代理数：<span id="total"></span>条 </h4>

									</div>
									<div class="box-body">
										<table id="db_Agent_list" cellpadding="0" cellspacing="0" border="0"
											class="datatable table table-striped table-bordered table-hover">

										</table>
									</div>
								</div>
								<!-- /BOX -->
							</div>
						</div>
						<!-- /TABLES -->


						<div class="footer-tools">
							<span class="go-top">
								<i class="fa fa-chevron-up"></i> Top
							</span>
						</div>
					</div><!-- /CONTENT-->
				</div>
			</div>
			<div class="modal fade" id="box-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
				aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title">设置会员等级</h4>
						</div>
						<div class="modal-body">
							<div class="form-group levelName">
								<label class="control-label col-md-3" style="line-height:34px;"><span
										class="required">*</span>选择等级：</label>
								<div class="col-md-4">
									<select id="order_type_select" name="level" class="col-md-12 select2-offscreen"
										tabindex="-1">
									</select>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
							<button type="button" class="btn btn-success bt-save">保存</button>
						</div>
					</div>
				</div>
			</div>
			<div class="modal fade" id="return-box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
				aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
							<h4 class="modal-title">代理支付详情</h4>
						</div>
						<div class="modal-body">
							<div class="form-group levelName"
								style="line-height:34px;margin-bottom: 0px;overflow: hidden;">
								<label class="control-label col-md-3" style="line-height:34px;">支付金额：</label>
								<div class="col-md-4 totalPrice">
									0
								</div>
							</div>
							<div class="form-group levelName"
								style="line-height:34px;margin-bottom: 0px;overflow: hidden;">
								<label class="control-label col-md-3" style="line-height:34px;">商家订单号：</label>
								<div class="col-md-4 orderPayCode">

								</div>
							</div>
							<div class="form-group levelName"
								style="line-height:34px;margin-bottom: 0px;overflow: hidden;">
								<label class="control-label col-md-3" style="line-height:34px;">退款渠道：</label>
								<div class="col-md-4 returnPayType">
								</div>
							</div>
							<div class="form-group levelName"
								style="line-height:34px;margin-bottom: 0px;overflow: hidden;">
								<label class="control-label col-md-3" style="line-height:34px;">
									<span class="required">*</span>
									实退金额：
								</label>
								<div class="col-md-4 realPrice">
									<input class="form-control" placeholder="请输入实退金额"
										onkeypress="return $.IsDecimal(event);" onblur="return $.IsMoney(this);"
										onfocus="this.select()" style="height:30px;width:200px;" type="text"
										name="realPrice">
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
							<button type="button" class="btn btn-success bt-save-return">撤销代理</button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!--/PAGE -->
	<!-- JAVASCRIPTS -->
	<!-- Placed at the end of the document so the pages load faster -->
	<!-- JQUERY -->
	<script src="../../js/jquery/jquery-2.0.3.min.js"></script>

	<!-- BOOTSTRAP -->
	<script src="../../bootstrap-dist/js/bootstrap.min.js"></script>
	<!-- BLOCK UI -->
	<script type="text/javascript" src="../../js/jQuery-BlockUI/jquery.blockUI.min.js"></script>

	<!-- AUTOSIZE -->
	<script type="text/javascript" src="../../js/autosize/jquery.autosize.min.js"></script>
	<!-- spinner -->
	<script src="../../js/spinner/spin.js"></script>
	<!-- DATA TABLES -->
	<script type="text/javascript" src="../../js/datatables/bootstrap-select.js"></script>
	<script type="text/javascript" src="../../js/datatables/datatable.js"></script>
	<script type="text/javascript" src="../../js/datatables/datatable-bootstrap.js"></script>
	<script type="text/javascript" src="../../js/datatables/datatable-tabletools.js"></script>
	<script type="text/javascript" src="../../js/datatables/fnAddTr.js"></script>

	<!-- INPUT MASK -->
	<script type="text/javascript" src="../../js/bootstrap-inputmask/bootstrap-inputmask.min.js"></script>
	<!--bootbox-->
	<script type="text/javascript" src="../../js/bootbox/bootbox.min.js"></script>
	<!-- SELECT2 -->
	<script type="text/javascript" src="../../js/select2/select2.min.js"></script>
	<!-- UNIFORM -->
	<script type="text/javascript" src="../../js/uniform/jquery.uniform.min.js"></script>
	<script type="text/javascript" src="../../js/datepicker/datepicker.js"></script>
	<!-- COOKIE -->
	<script type="text/javascript" src="../../js/jQuery-Cookie/jquery.cookie.min.js"></script>
	<!-- CUSTOM SCRIPT -->
	<script src="../../js/script.js"></script>
	<script src="../../js/common.js"></script>
	<script>
		var Agent = function () {
			var $mainDataTable = null;
			var searchAgent = function () {
				var nickName = $("input[name=nickName]").val();
				var userName = $("input[name=userName]").val();
				var status = $("#status_select").val();
				var levelId = $("[name=searchLevel]").select2('val');
				var url = App.getContextPath() + "admin/agent/searchAgent.do?nickName=" + nickName + "&userName=" + userName + '&levelId=' + levelId
				if (status != null && status != -1)
					url += "&checkStatus=" + status;
				var startDate = $("#startDate").val();
				var endDate = $("#endDate").val();
				if (startDate != "")
					url += "&startDate=" + startDate;
				if (endDate != "")
					url += "&endDate=" + endDate;
				var orderStartDate = $("#orderStartDate").val();
				var orderEndDate = $("#orderEndDate").val();
				if (orderStartDate != "")
					url += "&orderStartDate=" + orderStartDate;
				if (orderEndDate != "")
					url += "&orderEndDate=" + orderEndDate;
				if ($mainDataTable) {
					$mainDataTable.api().ajax.url(url).load();
					return;
				}
				var dtSetting = $.dataTableSetting({
					"ajaxSource": url,
					"serverSide": true,
					"bFilter": false,// 去掉搜索框
					"bLengthChange": true,// 每页显示数量							
					"sScrollX": "100%",
					"sScrollXInner": "100%",
					"iDisplayLength": 25,

					"bSort": false,
					"aoColumns": [
						{
							"mDataProp": "userName",
							"sTitle": "用户账号",
							"width": "8%",
							"render": function (dat, type, row) {
								return row.userName;
							}
						},
						{
							"mDataProp": "nickName",
							"sTitle": "昵称@会员",
							"width": "10%",
							"render": function (dat, type, row) {
								return row.nickName + " @ " + (row.level == 10 ? "女王会员" : "普通会员");
							}

						},
						{
							"sTitle": "会员等级名称",
							"width": "10%",
							"render": function(dat, type, row) {
							    return row.agentLevel === null ? "-" : row.agentLevel.levelName;
							}
						},
						{
							"sTitle": "返利比例",
							"width": "6%",
                            "render": function(dat, type, row) {
                                return row.agentLevel === null ? 1.0 : row.agentLevel.levelRate;
                            }
						},
						{
							"mDataProp": "shareCode",
							"sTitle": "邀请码",
							"width": "5%"
						}, /*{
								"sTitle" : "加入时间",
								"width" : "10%",
								"render":function(data, type, row){
								   return $.getLocalTime(row.receiveTime);
								}
							}, {
								"sTitle" : "状态",
								"width" : "7%",
								"render":function(data, type, row){
									var str="";
									   switch(row.checkStatus){
									     case "Waiting":str="待审核";break;
									     case "Pass":str="审核通过";break;									     
									     case "Reject":str="审批未通过";break;								     
									     case "Cancel":str="已取消";break;
									   }
									   return str;
								}														
							}, */ {
							"sTitle": "耕耘成果",
							"width": "8%",
							"render": function (data, type, row) {
								var userBalances = row.userBalanceList;
								if (userBalances && userBalances.length > 0) {
									var str = "";
									$(userBalances).each(function (idx, item) {
										if (item.platformNo === 'M000') {
											// str += "<p><span>"+item.platformName+"：</span>";
											if (item.cultivationPrice && item.cultivationPrice > 0) {
												str += "<a  href='../cps/source_user_cultivationMonth.html?userId=" + row.userId + "'>" + format_thousands(item.cultivationPrice) + "</a>";
											} else {
												str += "<span>0.00</span>";
											}
											str += "</p>";
										}
									});
									if (str === "") {
										str = "--";
									}
									return str;
								}
								return "--";
							}
						}, {
							"sTitle": "预计基金",
							"width": "8%",
							"render": function (data, type, row) {
								var userBalances = row.userBalanceList;
								if (userBalances && userBalances.length > 0) {
									var str = "";
									$(userBalances).each(function (idx, item) {
										// str += "<p><span>"+item.platformName+"：</span>";
										if (item.preincomePrice && item.preincomePrice > 0) {
											str += "<a  href='../cps/trade_detail.html?userId=" + row.userId + "&preincomePrice=" + item.preincomePrice + "&priceType=PreIncome&platformNo=" + item.platformNo + "'>" + format_thousands(item.preincomePrice) + "</a>";
										} else {
											str += "<span>0.00</span>";
										}
										str += "</p>";
									});
									return str;
								}
								return "--";
							}
						}, {

							"sTitle": "成长基金",
							"width": "6%",

							"render": function (data, type, row) {
								var userBalances = row.userBalanceList;
								if (userBalances && userBalances.length > 0) {
									var str = "";
									$(userBalances).each(function (idx, item) {
										// str += "<p><span>"+item.platformName+"：</span>";
										str += "<p><a  href='../cps/trade_detail.html?userId=" + row.userId + "&balancePrice=" + item.balancePrice + "&priceType=Balance&platformNo=" + item.platformNo + "'>" + format_thousands(item.balancePrice) + "</a>";
										str += "</p>";
									});
									return str;
								}
								return "--";
							}

						}, {
							"mDataProp": "checkTime",
							"sTitle": "加入时间",
							"width": "8%",
							"render": function (data, type, row) {
								return $.getLocalTime(row.receiveTime);
							}
						},/* {
								"mDataProp" : "expireTime",
								"sTitle" : "到期时间",
								"width" : "8%",
								"render":function(data, type, row){
									return $.getLocalTime(row.expireTime);
								}
							},*/ {
							"sTitle": "操作",
							"width": "20%",
							"render": function (data, type, row) {
								var tempArr = [];
								tempArr.push("<a class='btn btn-primary  btn-xs btn-width bt-remark' href='../cps/promotion_user.html?fromCode=" + row.userName + "' style='margin-left:10px;'><i class='fa fa-pencil-square-o'></i>查看粉丝</a>");
								if (row.checkStatus === 'WaitingCancel') {
									tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-delete' userId='" + row.userId + "' href='javascript:;' style='width:100px;margin-left:10px;'><i class='fa fa-pencil-square-o'></i>停止撤销代理</a>");
								} else {
									tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-cancel' usertype='UserAgent' openid='" + row.openId + "' href='javascript:;' userId='" + row.userId + "' style='margin-left:10px;'><i class='fa fa-pencil-square-o'></i>撤销代理</a>");
								}
								tempArr.push("<a class='btn btn-success btn-xs btn-width bt-set' userId='" + row.userId + "' href='javascript:void(0);' id='" + row.agentLevel.id + "' style='margin-left:10px;width:auto;'><i class='fa fa-pencil-square-o'></i>设置会员等级</a>");
								/* if(row.checkStatus=="Waiting"){
								var title="审批";
								var cl="bt-danger"
								if(row.checkStatus!="Waiting"){
									title="详情"	
									cl="btn-success";
								}				
								return "<a class='btn btn-success btn-xs btn-width' style='width:60px;margin-left:0px;margin-right:5px;margin-top:2px;' href='agent_detail.html?id="+row.id+"'><i class='fa fa-arrow-circle-o-up'></i>"+title+"</a>";
							 }else{
								 if(row.ygUser.userType != "Group"){
									 if(row.checkStatus=="Pass"){
											tempArr.push("<a class='btn btn-success bt-group btn-xs btn-width' href='javascript:;' openid='"+row.ygUser.openId+"' userId='"+row.userId+"'><i class='fa fa-pencil-square-o'></i>指定团长</a>");	
											tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-cancel' usertype='UserAgent' openid='"+row.ygUser.openId+"' href='javascript:;' userId='"+row.userId+"'><i class='fa fa-pencil-square-o'></i>撤销代理</a>");
											
										} else if(row.checkStatus=="WaitingCancel"){
											tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-delete' userId='"+row.userId+"' href='javascript:;' style='width:100px;'><i class='fa fa-pencil-square-o'></i>停止撤销代理</a>");
										}
										
										tempArr.push("<a class='btn btn-primary  btn-xs btn-width bt-remark' href='../cps/promotion_user.html?fromCode="+row.ygUser.userName+"'><i class='fa fa-pencil-square-o'></i>查看新用户</a>");
										
									} else {
										if (row.checkStatus != 'WaitingCancel') {
											tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-cancel' usertype='Group' userId='"+row.userId+"' openid='"+row.ygUser.openId+"' href='javascript:;'><i class='fa fa-pencil-square-o'></i>撤销团长</a>");
										} else {
											tempArr.push("<a class='btn btn-danger btn-xs btn-width bt-delete' userId='"+row.userId+"' href='javascript:;' style='width:100px;'><i class='fa fa-pencil-square-o'></i>停止撤销代理</a>");
										}
										tempArr.push("<a class='btn btn-primary  btn-xs btn-width bt-remark' href='../cps/promotion_user.html?groupTag="+row.ygUser.groupTag+"'><i class='fa fa-pencil-square-o'></i>查看新用户</a>");
									} */
								return tempArr.join('');
							}
						}
					]

				});

				$mainDataTable = $("#db_Agent_list").dataTable(dtSetting);
			};




			return {
				init: function () {
					$.initDate($("#form"), 0, 0);
					$("[name=startDate]").val('');
					$("[name=endDate]").val('');
					/* $("#status_select").select2({placeholder: "选择状态"});	  
					$("#type_select").select2({placeholder: "选择类型"});	   */

					$(".search").click(searchAgent);
					var userId = userName = userType = openId = '';
					var payInfo = {};
					var isGo = false
					$("#db_Agent_list").on("click", ".bt-cancel", function () {
						var tr = $(this).closest("tr");
						userId = $(this).attr("userId");
						userName = $(this).attr("userName");
						userType = $(this).attr('usertype');
						openId = $(this).attr('openid') == 'null' ? null : $(this).attr('openid');
						$.ajax({
							type: "get",
							url: App.getContextPath() + "admin/agent/agentPayInfo.do",
							data: { userId: userId, userName: userName, openId: openId },
							async: true,
							success: function (result) {
								if (result.type == 'error') {
									$.alert(result.extra);
								} else {
									var totalPrice = realPrice = 0;
									$('.returnPayType').closest('.form-group').hide();
									$('.orderPayCode').closest('.form-group').hide();
									var paymentCode = ''
									if (result.extra) {
										isGo = true
										realPrice = totalPrice = result.extra.paidPrice
										paymentCode = result.extra.paymentCode
										$('.returnPayType').html(result.extra.payTypeDesc + '支付')
										$('.returnPayType').closest('.form-group').show();
										$('.orderPayCode').closest('.form-group').show();
										payInfo = result.extra
									}
									$('.totalPrice').html(totalPrice)
									$('[name=realPrice]').val(realPrice)
									$('.orderPayCode').html(paymentCode)
									$('#return-box').modal('show')
								}
							}
						});

					});
					$('.bt-save-return').click(function () {
						var operation = '个人代理';
						var url = App.getContextPath() + "admin/agent/cancelRightNow.do";
						if (userType == 'Group') {
							operation = '团长';
							url = App.getContextPath() + "admin/agent/cancelRightNow.do";
						}
						var refundPrice = 0;
						if (isGo) {
							refundPrice = $('[name=realPrice]').val()
						}
						$.confirm('是否确认撤销该用户的' + operation + '身份？', function () {
							$.ajax({
								type: "get",
								url: url,
								data: { userId: userId, userName: userName, openId: openId, refundPrice: refundPrice },
								async: true,
								success: function (result) {
									if (result.type == 'error') {
										$.alert(result.content);
									}
									searchAgent();
									$('#return-box').modal('hide')
								}
							});
						});
					})
					$("#db_Agent_list").on("click", ".bt-group", function () {
						var tr = $(this).closest("tr");
						var userId = $(this).attr("userId");
						var userName = $(this).attr("userName");
						var openId = $(this).attr('openid') == 'null' ? null : $(this).attr('openid');
						$.confirm('是否确认指定该用户为团长？', function () {
							$.ajax({
								type: "get",
								url: App.getContextPath() + "admin/agent/createGroupHead.do",
								data: { userId: userId, userName: userName, openId: openId },
								async: true,
								success: function (result) {
									if (result.type == 'error') {
										$.alert(result.extra);
									}
									searchAgent();
								}
							});
						});

					});
					$("#db_Agent_list").on("click", ".bt-set", function () {
						var id = $(this).attr('id')
						var userId = $(this).attr('userId')
						$("[name=level]").select2('val', id)
						$("#box-config").modal("show");
						$("#box-config").find('.bt-save').attr('userId', userId)
					})
					$('.bt-save').on('click', function (params) {
						var levelId = $("[name=level]").select2('val')
						var userId = $(this).attr('userId')
						$.confirm('确认更改用户等级？', function () {
							$.ajax({
								type: "get",
								url: App.getContextPath() + "admin/agent/updateLevelRate.do",
								data: { userId: userId, levelId: levelId },
								async: true,
								success: function (result) {
									if (result.type == 'error') {
										$.alert(result.extra);
									}
									$("#box-config").modal("hide");
									searchAgent();
								}
							});
						});
					})
					$("#db_Agent_list").on("click", ".bt-delete", function () {
						var userId = $(this).attr('userId');
						$.confirm('是否停止对该用户的撤销资格进程？', function () {
							$.ajax({
								type: "get",
								url: App.getContextPath() + "admin/agent/deleteCancelAgent.do",
								data: { userId: userId },
								async: true,
								success: function (result) {
									if (result.type == 'error') {
										$.alert(result.extra);
									}
									searchAgent();
								}
							});
						});
					});
					$.ajax({
						type: "get",
						url: App.getContextPath() + "admin/agent/searchAgentLevel.do?levelName=",
						data: { start: -1, limit: -1 },
						async: true,
						success: function (result) {
							if (result.type == 'error') {
								$.alert(result.extra);
							} else {
								if (result.data) {
									for (var index = 0; index < result.data.length; index++) {
										var element = result.data[index];
										$("[name=level]").append('<option value="' + element.id + '">' + element.levelName + '</option>')
										$("[name=searchLevel]").append('<option value="' + element.id + '">' + element.levelName + '</option>')
									}
								}
							}
							$("[name=level]").select2({ placeholder: "选择等级" });
							$("[name=searchLevel]").select2({ placeholder: "选择等级" });
							searchAgent();
						}
					});
				}
			}
		}();

		$(function () {
			$("#header").load("../head.html");
			App.init(); //Initialise plugins and elements	 
			Agent.init();
		});
	</script>
	<!-- /JAVASCRIPTS -->
</body>

</html>